﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace Studio
{
	// Token: 0x02000454 RID: 1108
	public class IKCtrl : MonoBehaviour
	{
		// Token: 0x170002B8 RID: 696
		// (set) Token: 0x06001B98 RID: 7064 RVA: 0x000B17A0 File Offset: 0x000AF9A0
		public OCIChar.IKInfo addIKInfo
		{
			set
			{
				this.listIKInfo.Add(value);
			}
		}

		// Token: 0x170002B9 RID: 697
		// (get) Token: 0x06001B99 RID: 7065 RVA: 0x000B17B0 File Offset: 0x000AF9B0
		public int count
		{
			get
			{
				return this.listIKInfo.Count;
			}
		}

		// Token: 0x06001B9A RID: 7066 RVA: 0x000B17C0 File Offset: 0x000AF9C0
		public void InitTarget()
		{
			base.StartCoroutine("InitTargetCoroutine");
		}

		// Token: 0x06001B9B RID: 7067 RVA: 0x000B17D0 File Offset: 0x000AF9D0
		public void CopyBone(OIBoneInfo.BoneGroup _target)
		{
			foreach (OCIChar.IKInfo ikinfo in from i in this.listIKInfo
			where (i.boneGroup & _target) != (OIBoneInfo.BoneGroup)0
			select i)
			{
				ikinfo.CopyBone();
			}
		}

		// Token: 0x06001B9C RID: 7068 RVA: 0x000B1848 File Offset: 0x000AFA48
		private IEnumerator InitTargetCoroutine()
		{
			yield return new WaitForEndOfFrame();
			foreach (OCIChar.IKInfo ikinfo in this.listIKInfo)
			{
				ikinfo.CopyBaseValue();
			}
			yield break;
		}

		// Token: 0x06001B9D RID: 7069 RVA: 0x000B1864 File Offset: 0x000AFA64
		private void Awake()
		{
			this.listIKInfo = new List<OCIChar.IKInfo>();
		}

		// Token: 0x04001EFC RID: 7932
		private List<OCIChar.IKInfo> listIKInfo;
	}
}
